<?php

class Application_Model_Option extends Zend_Db_Table_Abstract
{
    protected $_name = "kp_options"; //Ten bang
    protected $_primary = "option_id"; //Khoa chinh
    protected $db;
    //Cac truong du lieu
    var $option_id;
    var $option_name;
    var $option_value;
    var $option_status=0;
    
    //Ham khoi tao
    public function __construct(){
        $this->db = Zend_Registry::get('db');
    }
    
    //Get all user
    public function getByName($name){
        $query = $this->db->select();
        $query->from($this->_name);
        $query->where('option_name =?',$name);
        $data =  $this->db->fetchRow($query);
        return $data['option_value'];
    }
}

